from datetime import datetime
from typing import Optional
from pydantic import BaseModel, ConfigDict


class FactorBase(BaseModel):
    fid: int
    factor_no: str
    factor_name: str
    factor_lvl: int
    up_factor_no: Optional[str]
    cert_type: str
    cert_no: str
    status: int
    contact_person: str
    email: str

    model_config = ConfigDict(
        strict=True,
        from_attributes=True
    )

class FactorDetail(FactorBase):
    address: Optional[str]
    create_by: Optional[str]
    update_by: Optional[str]
    create_time: Optional[datetime]
    update_time: Optional[datetime]
